package com.example.administrator.ttphonehelper.util;

import android.util.Log;

/**
 * Created by Administrator on 2016/3/30 0030.
 */
public class LogUtil {
    private final static boolean isDebug = true;
    private final static String TAG = "PuzzleGame";
    //传入TAG和msg
    public static void d(String tag,String msg)
    {
        if(isDebug)
        {
            Log.d(tag, msg);
        }
    }

    //使用默认的TAG
    public static void d(String msg)
    {
        if(isDebug)
        {
            Log.d(TAG, msg);
        }
    }

    //自动生成TAG，Tag是类名
    public static void d(Object obj,String msg)
    {
        if(isDebug)
        {
            //obj.getClass().getSimpleName() 取得对象的类名
            Log.d(obj.getClass().getSimpleName(), msg);
        }
    }
}
